package com.basic;


import com.frame.struts.BaseBean;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class OperationStateForm extends BaseBean{
    public OperationStateForm() {
    }


	OperationStateEntity os = new OperationStateEntity();

		public String addOperationState() {
			System.out.println("aaaa");
			HttpServletRequest request = ActionContext.getActionContext().
				getRequest();
			HttpServletResponse response = ActionContext.getActionContext().
				getResponse();
			BasicFactory factory = new BasicFactory();
			String qyid = (String) request.getSession().getAttribute("session_qyid");
			os.setQyid(qyid);
			os.setOptdate(new Date());
			os.setOptrid(CommUtil.getUserId(request));
			try{
			if (factory.addOperationState(os)) {
					response.sendRedirect("/basic/queryOperationState.jsp");
					return "success";
			}
			response.sendRedirect("/basic/failed.jsp");
		  }
		  catch (Exception e) {

		  }

			return "failed";
		}

		public String modifyOperationState(){
				HttpServletRequest request = ActionContext.getActionContext().
					getRequest();
				HttpServletResponse response = ActionContext.getActionContext().
					getResponse();
				BasicFactory factory = new BasicFactory();
				String qyid = (String) request.getSession().getAttribute("session_qyid");
				os.setQyid(qyid);
				os.setOptdate(new Date());
				os.setOptrid(CommUtil.getUserId(request));
				factory.deleteOperationState(os.getId());
				try{
				if (factory.addOperationState(os)) {
						response.sendRedirect("/basic/queryOperationState.jsp");
						return "success";
				}
				response.sendRedirect("/basic/failed.jsp");
			  }
			  catch (Exception e) {

			  }

				return "failed";
			}

	/**
	 * @return os. return os.s the fgqy.
	 */
	public String getFgqy() {
		return os.getFgqy();
	}
	/**
	 * @param fgqy The fgqy to set.
	 */
	public void setFgqy(String fgqy) {
		os.setFgqy(fgqy);
	}
	/**
	 * @return os. return os.s the id.
	 */
	public int getId() {
		return os.getId();
	}
	/**
	 * @param id The id to set.
	 */
	public void setId(int id) {
		os.setId(id);
	}
	/**
	 * @return os. return os.s the jbyw.
	 */
	public String getJbyw() {
		return os.getJbyw();
	}
	/**
	 * @param jbyw The jbyw to set.
	 */
	public void setJbyw(String jbyw) {
		os.setJbyw(jbyw);
	}
	/**
	 * @return os. return os.s the jsxjx.
	 */
	public String getJsxjx() {
		return os.getJsxjx();
	}
	/**
	 * @param jsxjx The jsxjx to set.
	 */
	public void setJsxjx(String jsxjx) {
		os.setJsxjx(jsxjx);
	}
	/**
	 * @return os. return os.s the mlr.
	 */
	public double getMlr() {
		return os.getMlr();
	}
	/**
	 * @param mlr The mlr to set.
	 */
	public void setMlr(double mlr) {
		os.setMlr(mlr);
	}
	/**
	 * @return os. return os.s the nsr.
	 */
	public double getNsr() {
		return os.getNsr();
	}
	/**
	 * @param nsr The nsr to set.
	 */
	public void setNsr(double nsr) {
		os.setNsr(nsr);
	}
	/**
	 * @return os. return os.s the optdate.
	 */
	public Date getOptdate() {
		return os.getOptdate();
	}
	/**
	 * @param optdate The optdate to set.
	 */
	public void setOptdate(Date optdate) {
		os.setOptdate(optdate);
	}
	/**
	 * @return os. return os.s the optrid.
	 */
	public String getOptrid() {
		return os.getOptrid();
	}
	/**
	 * @param optrid The optrid to set.
	 */
	public void setOptrid(String optrid) {
		os.setOptrid(optrid);
	}
	/**
	 * @return os. return os.s the qyid.
	 */
	public String getQyid() {
		return os.getQyid();
	}
	/**
	 * @param qyid The qyid to set.
	 */
	public void setQyid(String qyid) {
		os.setQyid(qyid);
	}
	/**
	 * @return os. return os.s the recstate.
	 */
	public String getRecstate() {
		return os.getRecstate();
	}
	/**
	 * @param recstate The recstate to set.
	 */
	public void setRecstate(String recstate) {
		os.setRecstate(recstate);
	}
	/**
	 * @return os. return os.s the remark.
	 */
	public String getRemark() {
		return os.getRemark();
	}
	/**
	 * @param remark The remark to set.
	 */
	public void setRemark(String remark) {
		os.setRemark(remark);
	}
	/**
	 * @return os. return os.s the ywfw.
	 */
	public String getYwfw() {
		return os.getYwfw();
	}
	/**
	 * @param ywfw The ywfw to set.
	 */
	public void setYwfw(String ywfw) {
		os.setYwfw(ywfw);
	}
	/**
	 * @return os. return os.s the ywgm.
	 */
	public String getYwgm() {
		return os.getYwgm();
	}
	/**
	 * @param ywgm The ywgm to set.
	 */
	public void setYwgm(String ywgm) {
		os.setYwgm(ywgm);
	}

}